/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Figuras;

/**
 *
 * @author Gustavo Canul Poot
 */
public class Trapecio extends Cuadrilatero{

   public Trapecio(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) {
        super(x1, y1, x2, y2, x3, y3, x4, y4);
    }
   

    @Override
    public double area() {
        double c = this.getX4() - this.getX4();
       double d = this.getY4()- this.getY1();
       double alt = Math.sqrt(Math.pow(c,2)+Math.pow(d, 2));
        
        if(getDist2() == getDist4())
        {
            return ((getDist()+getDist6())/2)*alt;
        }
        
        else
        {
            return 0.0;
        }
        
        
    }

    
    
    
    
    
    
    
    
    
    
}
